package game;

/**
 * 医生
 */
public class Doctor extends Role{
    public Doctor(String name,int level){
        super(name,level);
        this.setHpWeight(12);
        this.setAttackWeight(2);
        this.setDefineWeight(2);
        this.init();
    }

    /**
     * 治疗自己
     */
    public void treat(){
        int hp = this.getLevel() * 2;
        if(this.getMaxHp() < hp + this.getHp()){
            this.setHp(this.getMaxHp());
        }else{
            this.setHp(hp + this.getHp());
        }
    }
    /**
     * 治疗盗贼
     */
    public void treat(Thieves thieves){
        int hp = thieves.getLevel() * 2;
        if(thieves.getCoin() >= hp){
            if(thieves.getMaxHp() < hp + thieves.getHp()){
                thieves.setHp(thieves.getMaxHp());
            }else{
                thieves.setHp(hp + thieves.getHp());
            }
            System.out.println("已恢复体力");
        }else{
            System.out.println("对不起，你没有钱进行治疗，自己等死吧");
        }

    }
    /**
     * 治疗猎人
     */
    public void treat(Hunter hunter){
        int hp = this.getLevel() * 2;
        if(hunter.getCoin() >= hp){
            if(hunter.getMaxHp() < hp + hunter.getHp()){
                hunter.setHp(hunter.getMaxHp());
            }else{
                hunter.setHp(hp + hunter.getHp());
            }
            System.out.println("已恢复体力");
        }else{
            System.out.println("对不起，你没有钱进行治疗，自己等死吧");
        }

    }
}
